<% slot = slot || nil %>
<% piece = piece || slot.piece %>

<div class="vtrg-edit-wrapper" data-id="<%= (slot ? slot.id : 'new') %>">
  <% ['top', 'bottom'].each do |position_class| %>
    <div class="vtrg-edit-control <%= position_class %>">
      <a href="javascript:void(0)" role="button" rel="move" class="vtrg-edit-control-move" title="<%= t('vitrage.move') %>">
        <%= evil_icon 'ei-retweet', size: "m" %>
      </a>
      <a href="javascript:void(0)" role="button" rel="edit" title="<%= t('vitrage.edit') %>">
        <%= evil_icon 'ei-pencil', size: "m" %>
      </a>
      <a href="javascript:void(0)" role="button" rel="destroy" title="<%= t('vitrage.destroy') %>">
        <%= evil_icon 'ei-trash', size: "m" %>
      </a>
    </div>
  <% end %>
  <div class="vtrg-edit-block-cover"><%= evil_icon 'ei-spinner', size: "m" %></div>
  <div class="vtrg-edit-body">
    <%= render partial: "vitrage/#{piece.class.name.demodulize.underscore}", locals: { piece: piece } %>
  </div>
</div>
